package org.smr.ministore.micro.client;

import java.util.List;

import org.blade.utils.Pager;
import org.smr.ministore.entities.BrandOrgan;
import org.smr.ministore.entities.vo.BrandOrganQuery;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("BrandOrgan.service")
public interface FeignBrandOrganMicroServiceClient {

    @RequestMapping(method = RequestMethod.PUT, value = "/BrandOrgan/batchSave")
    int batchSave(@RequestBody List< BrandOrgan> entities);

    @RequestMapping(method = RequestMethod.POST, value = "/BrandOrgan/batchModify")
    int batchModify(@RequestBody List< BrandOrgan> entities);

    @RequestMapping(method = RequestMethod.PUT, value = "/BrandOrgan/save")
    public int save(@RequestBody BrandOrgan entity) ;

    @RequestMapping(method = RequestMethod.PATCH, value = "/BrandOrgan/updateById")
    public int updateById(@RequestBody BrandOrgan id);

    @RequestMapping(method = RequestMethod.GET, value = "/BrandOrgan/queryById/{id}")
    public  BrandOrgan queryById(@PathVariable("id")Long id);

    @RequestMapping(method = RequestMethod.DELETE, value = "/BrandOrgan/deleteById/{id}")
    public int deleteById(@PathVariable("id")Long id);

    @RequestMapping(method = RequestMethod.POST, value = "/BrandOrgan/paginate")
    public Pager<BrandOrgan> paginate( @RequestBody BrandOrgan entity, Long pageSize, Long pageNum);

    /**
     * 根据业务条件查询
     * @param brandOrgan 业务条件
     * @return BrandOrgan
     *
     */
    @RequestMapping(method = RequestMethod.POST, value = "/BrandOrgan/queryBy")
    BrandOrgan queryBy(@RequestBody BrandOrgan brandOrgan);

    @ResponseBody
    @RequestMapping(method = RequestMethod.POST, value = "/BrandOrgan/queryAlreadyAssignedOrgans")
    List<BrandOrgan> queryAlreadyAssignedOrgans(@RequestBody BrandOrganQuery brandOrganQuery);
}
